//
//  HWUserXiaoXiCell.m
//  HWanGame
//
//  Created by 陈道斌 on 2019/8/30.
//  Copyright © 2019 Chendaobin. All rights reserved.
//

#import "HWUserXiaoXiCell.h"


@interface HWUserXiaoXiCell()
@property (weak, nonatomic) IBOutlet UIImageView *icomageView;
@property (weak, nonatomic) IBOutlet UILabel *nameLabel;
@property (weak, nonatomic) IBOutlet UILabel *miaoshuLabel;
@property (weak, nonatomic) IBOutlet UILabel *datelabel;

@end

@implementation HWUserXiaoXiCell

- (void)awakeFromNib {
    [super awakeFromNib];
    [self layoutSubviews];
    
    // Initialization code
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}

- (IBAction)xiangqing:(UIButton *)sender {
}


// 改变滑动删除按钮样式
- (void)layoutSubviews {
    [super layoutSubviews];
    
    
    for (UIView *subView in self.subviews){
        if([subView isKindOfClass:NSClassFromString(@"UITableViewCellDeleteConfirmationView")]) {
            CGRect cRect = subView.frame;
            cRect.size.height = self.contentView.frame.size.height - 10;
            subView.frame = cRect;
            
            UIView *confirmView=(UIView *)[subView.subviews firstObject];
            // 改背景颜色
            confirmView.backgroundColor=[UIColor colorWithRed:254/255.0 green:85/255.0 blue:46/255.0 alpha:1];
            for(UIView *sub in confirmView.subviews){
                if([sub isKindOfClass:NSClassFromString(@"UIButtonLabel")]){
                    UILabel *deleteLabel=(UILabel *)sub;
                    // 改删除按钮的字体
                    deleteLabel.font=[UIFont boldSystemFontOfSize:15];
                    // 改删除按钮的文字
                    deleteLabel.text=@"删除";
                }
            }
            break;
        }
    }
}

@end
